<template>
	<view>
		<!-- <view v-html="agreementData"></view> -->
		<rich-text :nodes="agreementData"></rich-text>
		<!-- <view>{{agreementData}}</view> -->
	</view>
</template>

<script>
	export default {
		components: {
		},
		data() {
			return {
				agreementData: ''
			}
		},
		onLoad(option) {
			this.gatAgreement(option.type)
		},
		methods: {
			/**
			 * 获取条款富文本
			 * @param {String} type
			 */
			async gatAgreement(type) {
				let res = await this.$http.request({
					method: 'post',
					url: type === '0' ? '/api/version/lease_protocol' : '/api/version/order_protocol',
					data: {}
				})
				if (res.status === 1) {
					this.agreementData = res.data
					console.log('this.agreementData:' , this.agreementData)
				} else {
					uni.showToast({
						title: res.message,
						icon: 'none',
						duration: 3000
					})
				}
			},
		}
	}
</script>

<style lang="scss">
</style>
